package day9;

// 定义交通工具类
class Vehicle {
    private String brand;
    private String model;

    public Vehicle(String brand, String model) {
        this.brand = brand;
        this.model = model;
    }

    public void drive() {
        System.out.println(brand + " " + model + " 开始启动，张三开车去公司！");
    }
}

// 定义人类
class Person {
    private String name;

    public Person(String name) {
        this.name = name;
    }

    public void driveToWork(Vehicle vehicle) {
        System.out.println(name + " 上车准备出发！");
        vehicle.drive();
        System.out.println(name + " 到达公司。");
    }
}

// 主程序
public class Main {
    public static void main(String[] args) {
        // 实例化交通工具
        Vehicle car = new Vehicle("Toyota", "Camry");

        // 实例化人物
        Person zhangsan = new Person("张三");

        // 张三开车去公司
        zhangsan.driveToWork(car);
    }
}
